package vo
{
	import cultu.supplier.message.Media;
	import cultu.supplier.message.Product;
	
	import mx.collections.ArrayCollection;
	
	public class ProductVO
	{
		/**le produit source*/
		public var srcProduct:Product;
		
		public function ProductVO(o:Product)
		{
			if(o)
			{
				srcProduct = o;
			}
			else
			{
				srcProduct = new Product();
			}
		}
		
		public function get label():String
		{
			return srcProduct.label;
		}
		
		public function get mediasColl():ArrayCollection
		{
			return srcProduct.medias;
		}
		
		public function get annotations():ArrayCollection
		{
			return srcProduct.annotations;
		}
		
		public function get description():String
		{
			return srcProduct.description;
		}
		
		public function get note():Number
		{
			return srcProduct.note;
		}
		
		public function get price():Number
		{
			return srcProduct.price;
		}
		
		public function get mainMedia():Media
		{
			if(mediasColl)
			{
				for(var i:int=0;i<mediasColl.length;i++)
				{
					var med:Media = mediasColl.getItemAt(i) as Media;
					if(med.main)
						return med;
				}
			}
			
			return null;
		}
	}
}